package com.markus.code.图.图1;

import java.util.Set;

/**
 * Author:markusZhang
 * Date:Create in 2020/8/19 13:40
 * todo: 测试最小生成树
 */
public class TestKDemo {
    public static void main(String[] args) {
        int [][]matrix = {{1,1,2},{100,1,4},{2,1,3},{3,2,3},{200,2,5},{500,3,4}};
        Graph graph = GraphGenerator.createNoGraph(matrix);
        System.out.println("K算法");
        GraphK graphK = new GraphK();
        Set<Edge> edges = graphK.graphK(graph);
        for (Edge edge : edges) {
            System.out.print(edge.weight+" ");
        }
        System.out.println();
        System.out.println("P算法");
        GraphP graphP = new GraphP();
        Set<Edge> edges1 = graphP.graphP(graph);
        for (Edge edge : edges1) {
            System.out.print(edge.weight+" ");
        }
    }
}
